package feeinterface.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ulwx.tool.DbUtils;

import feeinterface.modeldb.ServiceCp;

/**
 * 业务CP表
 * 
 * @author scj
 * 
 */
public class ServiceCpDao {

	/**
	 * t通过合作ID获取业务cp记录
	 * 
	 * @param CoID
	 * @return
	 * @throws Exception
	 */
	public static ServiceCp getBy(int CoID) throws Exception {

		String sql = "select * from ServiceCp a,ServiceCo b"
				+ " where a.ServiceCpSno=b.ServiceCpID and"
				+ " b.ServiceCoSno=? and b.Enable=1";
		Map<Integer, Object> map = new HashMap<Integer, Object>();
		map.put(1, CoID);
		List<ServiceCp> list = DbUtils.doQueryClass(null, ServiceCp.class, sql,
				map);
		if (list.size() > 0) {
			return list.get(0);
		}
		return null;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
